package tako.wisers.com.android.apis.handler;

import android.os.Message;
import tako.wisers.com.android.apis.activity.Tako;
import tako.wisers.com.android.apis.event.Event;
import tako.wisers.com.android.apis.util.Global;

public class MapSwitchHandler extends TakoHandler implements Handler<Event>{

	public MapSwitchHandler(Tako tako) {
		super(tako);
	}

	public void execute(Event event) {
		Message msg = mhandler.obtainMessage(0);
		if (tako.getBottomDisplay() != Global.MAP_DISPLAY) {
			msg.what = 1;
			tako.setBottomDisplay(Global.MAP_DISPLAY);
		}
		mhandler.sendMessage(msg);
	}

	private android.os.Handler mhandler = new android.os.Handler() {
		@Override
		public void handleMessage(Message msg) {
			if (msg.what == 1){
				tako.switchDisplay(Global.MAP_DISPLAY);
			}
		}
	};

}
